import express, { response } from 'express'
import path from 'path'
import {connection} from './MySQL'
import uuid from 'node-uuid'
import fs from 'fs'
let filePath = path.join(__dirname,'./public')
let app = express() //创建express服务器
app.use(  //处理静态资源
    express.static(filePath)
)
app.use(    //处理参数
    express.urlencoded()
)
app.use(   //处理post请求参数
    express.json()
)

//测试
app.post("/list",(request,response)=>{
    console.log(request.body);
    response.send({
        code:"03",
        msg:"测试",
        data:5
    })
})


//设置服务器端口号
app.listen(7000, () => {
    console.log("服务器连接成功");
    console.log('http://localhost:7000')
})
